package com.example.mapper;

import com.example.pojo.Collection;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

@Mapper
public interface CollectionMapper {
    @Insert("insert into collection(name, area, room_type, price, date, image, id_u, id_a) values (#{name}, #{area}, #{roomType}, #{price}, #{date}, #{image}, #{idU},#{idA})")
    void addConllection(Collection collection);

    @Delete("delete from collection where id=#{id} and id_u=#{idU}")
    void delCollection(Integer id, Integer idU);

    List<Collection> getCollection(String name, LocalDateTime date, Integer idU);

}
